import { IsNotEmpty, IsNumber, IsOptional, IsString, Length, Min } from "class-validator";

export default class CreateDto {
    @Min(0)
    @IsNumber()
    @IsNotEmpty()
    @IsOptional()
    parentId:number;

    @Min(1)
    @IsNumber()
    @IsNotEmpty()
    categoryId:number;


    @Length(1, 30)
    @IsString()
    name:string;

    @Length(1, 20)
    @IsString()
    code:string;
}